package ZY;

import java.util.Scanner;

//定义一个double类型的数组，长度是8，求数组中所有数的积
public class SZzy_5 {
    public static void main(String[] args) {
        double[] i = new double[8];
        Scanner sa = new Scanner(System.in);
        //键盘输入数组中的数
        for (int a = 0; a < i.length; a++) {
            System.out.println("请输入数组第" + (a + 1) + "个数");
            i[a] = sa.nextDouble();
        }
        System.out.println("你输入的数如下：");
        //打印输入的数
        for (int a = 0; a < i.length; a++) {
            System.out.print(i[a] + "  ");
        }
        //定义一个值，for循环求乘积
        double j = 1;
        for (int a = 0; a < i.length; a++) {
            j = j * i[a];
        }
        System.out.println("他们的乘积是" + j);
    }
}
